package com.corpgovernment.common.currency.client;

import com.corpgovernment.common.base.JSONResult;
import com.corpgovernment.common.currency.client.dto.req.CurrencyExchangeReqDTO;
import com.corpgovernment.common.currency.client.dto.resp.CurrencyExchangeRespDTO;
import com.corpgovernment.common.currency.client.dto.resp.CurrencyRespDTO;
import com.corpgovernment.common.currency.client.dto.resp.ExchangeTokenRespDTO;
import com.corpgovernment.common.currency.client.dto.resp.GetExchangeInfoRespVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author ldma
 * @date 2023/8/21
 */
@FeignClient(name = "basic-manage", qualifier = "basicManageCurrencyClient", fallback = BasicManageCurrencyClientFallBack.class)
public interface BasicManageCurrencyClient {

    @PostMapping("/currency/updateExchangeRate")
    JSONResult<String> updateExchangeRate();

    @PostMapping("/currency/updateCurrencyRuleCache")
    JSONResult<String> updateCurrencyRuleCache();

    @PostMapping("/currency/listSupportCurrency")
    JSONResult<List<CurrencyRespDTO>> listSupportCurrency();

    @PostMapping("/currency/exchange")
    JSONResult<CurrencyExchangeRespDTO> exchangeCurrency(@RequestBody CurrencyExchangeReqDTO currencyExchangeReqDTO);

    @PostMapping("/currency/exchangeToken")
    JSONResult<ExchangeTokenRespDTO> getExchangeToken(@RequestParam("exchangeToken") String exchangeToken);

    @PostMapping("/currency/getExchangeInfo")
    JSONResult<GetExchangeInfoRespVo> getExchangeInfo(@RequestParam("fromCurrencyCode") String fromCurrencyCode, @RequestParam("toCurrencyCode") String toCurrencyCode);

}
